package com.jctrip.hotel.source.model.greentree.resp;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;
import com.jctrip.hotel.source.model.greentree.req.GreenTreeBaseReq;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author：Haruhi
 * @description:
 * @Date：2023/8/31 14:17
 * @Package：com.jctrip.hotel.source.model.greentree.req
 * @Project：hotel-main
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@JacksonXmlRootElement(localName = "Availability")
public class GetAllRoomCountAndPriceActivityResp extends GreenTreeBaseResp {
    @JacksonXmlProperty(localName = "HotelInfomation")
    private HotelInformation hotelInformation;

    @JacksonXmlProperty(localName = "ReqRooms")
    private ReqRooms reqRooms;

    @JacksonXmlProperty(localName = "TotalRate")
    private TotalRate totalRate;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class HotelInformation {
        @JacksonXmlProperty(localName = "HotelCode")
        private String hotelCode;

        @JacksonXmlProperty(localName = "HotelName")
        private String hotelName;

        @JacksonXmlProperty(localName = "HotelAddress")
        private String hotelAddress;

        @JacksonXmlProperty(localName = "CityName")
        private String cityName;

        @JacksonXmlProperty(localName = "CityCode")
        private String cityCode;

        @JacksonXmlProperty(localName = "CountryCode")
        private String countryCode;

        @JacksonXmlProperty(localName = "PostalCode")
        private String postalCode;

        @JacksonXmlProperty(localName = "ContactEmail")
        private String contactEmail;

        @JacksonXmlProperty(localName = "ContactPhone")
        private String contactPhone;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class ReqRooms {
        @JacksonXmlElementWrapper(useWrapping = false)
        @JacksonXmlProperty(localName = "ReqDate")
        private List<ReqDate> reqDateList;

        @Data
        @NoArgsConstructor
        @AllArgsConstructor
        @Builder
        public static class ReqDate {
            @JacksonXmlProperty(localName = "date",isAttribute = true)
            private String date;

            @JacksonXmlProperty(localName = "ReqRoom")
            private ReqRoom reqRoomList;

            @Data
            @NoArgsConstructor
            @AllArgsConstructor
            @Builder
            public static class ReqRoom {
                @JacksonXmlProperty(localName = "roomTypeCode",isAttribute = true)
                private String roomTypeCode;

                @JacksonXmlProperty(localName = "roomTypeDescript",isAttribute = true)
                private String roomTypeDescript;

                @JacksonXmlProperty(localName = "ratePlanCode",isAttribute = true)
                private String ratePlanCode;

                @JacksonXmlProperty(localName = "ratePlanDescript",isAttribute = true)
                private String ratePlanDescript;

                @JacksonXmlProperty(localName = "activityCode",isAttribute = true)
                private String activityCode;

                @JacksonXmlProperty(localName = "RoomCount")
                private Integer roomCount;

                @JacksonXmlProperty(localName = "RoomRate")
                private RoomRate roomRate;

                @Data
                @NoArgsConstructor
                @AllArgsConstructor
                @Builder
                public static class RoomRate {
                    @JacksonXmlProperty(localName = "currencyCode",isAttribute = true)
                    private String currencyCode;

                    @JacksonXmlText
                    private BigDecimal price;
                }
            }
        }
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class TotalRate {
        @JacksonXmlProperty(localName = "currencyCode",isAttribute = true)
        private String currencyCode;

        @JacksonXmlText
        private BigDecimal totalRatePrice;
    }
   
}
